19.9 AT^SRADC Configure and Read ADC MeasurementThe AT^SRADC configures the parameters required for ADC measurement (Analog-to-Digital Converter) and returns the measurement result(s). The value(s) can be delivered once on request by using the single measurement mode, or periodically by specifying the measurement interval.
Note that the TC65 Module uses an unbalanced input with two pins, while the TC65 Terminal has a balanced input with four pins. This requires different pin names as listed below. See also [2] and [3].
First ADC channel of TC65 Module: ADC1_IN.
Second ADC channel of TC65 Module: ADC2_IN.
First ADC channel of TC65 Terminal: ADC1_IN_P and ADC1_IN_N
Second ADC channel of TC65 Terminal: ADC2_IN_P and ADC2_IN_N
Another major difference between both products is that the TC65 Terminal requires the measured ADC voltages to be recalculated. For detail see parameter <value> below as well as the AT^SAADC command.
Single measurement. Implies automatic channel open and close (<oc>=1 and 0) and no interval (<it>=0).
URC indicating the used channel, the number of measured samples and the voltage. Applies only if periodic measurement mode is enabled.^SRADC: <ch>, <count>, <value>[, <value>[, <value>[, <value>[, <value>[, <value>[, <value>[, <value>[, <value>[, <value>[, <value>]]]]]]]]]]
<ch>(num)First ADC channel
(ADC1_IN at TC65 Module.ADC1_IN_P and ADC1_IN_N at TC65 Terminal.)Second ADC channel
(ADC2_IN at TC65 Module.ADC2_IN_P and ADC2_IN_N at TC65 Terminal.)
<oc>(num)
<it>(num)
<value>(num)Measured voltage in mV
Resolution: 1mV for TC65 Module resp. 2.083mV for TC65 Terminal
Accuracy (typ.): 2mV for TC65 Module resp. 4mV for TC65 Terminal
The captured value is the actual voltage applied at the ADCx_IN input. No further calculation is required.
However, in the case of the TC65 Terminal, the captured value is a raw value. The exact voltage measured at the ADCx_IN_P and ADCx_IN_N inputs needs to be recalculated using the values obtained with AT^SAADC. See AT^SAADC for detail.
<count>(num)Number of measured samples
In single measurement mode: <count> is always 1.
In periodic measurement mode: <count> is number of <value>s indicated by each URC "^SRADC". The higher the sample rate set with <it>, the more measured values are reported within the URC "^SRADC".
• If power saving is enabled with AT+CFUN, take into account that the periodic mode lets the ME consume current each time the measurement is performed. This reduces the effect of power saving and thus decreases the operation time.
• If an AT command is input on the same interface where the periodic measurement mode is on, up to 5 "^SRADC" URCs are queued up and sent after AT command completion.
If more than 5 URCs occur before the AT command is completed their measurement values are lost. In this case, one additional URC with a negative <count> and the single value "32767" is sent along with the first 5 buffered URCs. The negative <count> indicates the number of lost measurement values (not the number of URCs). See example below.
Start periodic measurement mode on the first ADC channel. Samples are taken every 5s. Every 5s the URC "^SRADC" appears to report the measured voltages. The second parameter represents the number of measured samples, in this case only one.
Start periodic measurement on the first ADC channel. Samples are taken every 250ms. Every second a URC "^SRADC" appears to report the measured voltage. The number of samples is 4 or 5.
EXAMPLE 4
Start periodic measurement mode on the first ADC channel. Samples are taken every 250ms. 4 URCs were buffered during command input and sent after completion. 5 URCs were buffered during command input and sent after completion, another 2 URCs are lost.
|